package com.niiwoo.civet.trade.dto.response.invest;

import java.io.Serializable;
import java.math.BigDecimal;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@ToString
public class DayInvestorPlanInfoDTO implements Serializable, Comparable<DayInvestorPlanInfoDTO> {
	private static final long serialVersionUID = 6775508604256966107L;
	
	// 标的title
	private String projectTitile;
	// 总期数
	private Integer totalPeriod;
	// 当前期数
	private Integer currentPeriod;
	// 期数单位，1-月；2-天；
	private Byte deadlineUnit;
	// 借款利率
	private BigDecimal borrowRate;
	// 待收金额
	private BigDecimal unreceivedAmount;
	// 逾期预计垫付日期
	private String advanceOverdueDays;
	// 是否垫付回款，0-否；1-是
	private Byte isGuarantee;
	// 状态
	private Byte status;
	// 标的ID
	private String projectId;
	// 投资订单ID
	private String investOrderId;
	
	@Override
	public int compareTo(DayInvestorPlanInfoDTO obj) {
		byte statusDiff = (byte) (this.getStatus() - obj.getStatus());
		if (statusDiff == 0) {
			return (Long.valueOf(this.getProjectId()) - Long.valueOf(obj.getProjectId())) > 0 ? 1 : -1;
		}
		return statusDiff;
	}
}
